import Vue from 'vue'
import Router from 'vue-router'

import login from '@/components/login' //登录页
import home from '@/components/home' //综合首页

import mypage from '@/components/home/mypage' //首页项目
import workpage from '@/components/home/workpage' //首页文章
import docpage from '@/components/home/docpage' //首页日记

import itemCare from '@/components/pageModule/itemCare' //项目列表
import itemsDetails from '@/components/secondPage/itemsDetails'//项目详情页
import articleDetails from '@/components/secondPage/articleDetails'//文章详情页

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/home',//中间页
      name: 'home',
      component: home,
      children:[//嵌套路由
        { path: 'index', component: mypage},//项目列表页
        { path: 'workpage',component: workpage},//文章列表页
        { path: 'docpage', component: docpage}, //日记列表页
        {
          path: '/home/index/itemsDetails',//项目详情页
          name: 'itemsDetails',
          component: itemsDetails
        },
        {
          path: '/home/workpage/articleDetails',//文章详情页
          name: 'articleDetails',
          component: articleDetails
        }
      ]
    },
    {
			path: '/itemCare',//项目模块
			name: 'itemCare',
			component: itemCare
		}
  ]
})
